package org.jeecg.modules.system.service.impl;

import org.apache.catalina.User;
import org.jeecg.modules.system.entity.SysDepartPosition;
import org.jeecg.modules.system.entity.SysUserPosition;
import org.jeecg.modules.system.mapper.SysUserPositionMapper;
import org.jeecg.modules.system.service.ISysUserPositionService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 用户岗位表
 * @Author: jeecg-boot
 * @Date:   2019-08-04
 * @Version: V1.0
 */
@Service
public class SysUserPositionServiceImpl extends ServiceImpl<SysUserPositionMapper, SysUserPosition> implements ISysUserPositionService {
	
	@Autowired
	private SysUserPositionMapper sysUserPositionMapper;

	
	@Override
	public List<SysUserPosition> selectByMainId(String mainId,String sqlMap) {
		return sysUserPositionMapper.selectByMainId(mainId,sqlMap);
	}
	@Override
	public List<SysUserPosition> selectServerByMainId(String mainId,String tenantId) {
		return sysUserPositionMapper.selectServerByMainId(mainId,tenantId);
	}

	@Override
	public Integer selectPosition(Map map) {
		return sysUserPositionMapper.selectPosition(map);
	}

	@Override
	public SysUserPosition existPosition(String userId) {
		return sysUserPositionMapper.existPosition(userId);
	}

	@Override
	public Integer updatePosition(String str, String userId) {
		return sysUserPositionMapper.updatePosition(str,userId);
	}

	@Override

	public List<SysDepartPosition> selectPositionId(String userId) {
		return sysUserPositionMapper.selectPositionId(userId);
	}

	@Override
	public List<SysUserPosition> selectPositionIds(String departId) {
		return sysUserPositionMapper.selectPositionIds(departId);
	}

	@Override
	public void addBatch(String userId, String departId, List<SysDepartPosition> sysDepartPosition) {
		sysUserPositionMapper.addBatch(userId,departId,sysDepartPosition);
	}

	@Override
	public List<SysUserPosition> selectDepartPosition(String userId) {
		return sysUserPositionMapper.selectDepartPosition(userId);
	}



	@Override
	public Integer selectByDepartPositionId(String receiveAttr, String userId) {
		return sysUserPositionMapper.selectByDepartPositionId(receiveAttr,userId);
	}

	@Override
	public void editBatch(String userId, String oldDepartId,String newDepartId ,List<SysDepartPosition> sysDepartPositions) {
		sysUserPositionMapper.editBatch(userId,oldDepartId);
		sysUserPositionMapper.addBatch(userId,newDepartId,sysDepartPositions);
	}

	@Override
	public List<String> queryPositionId(String userId, String parentId) {
		return sysUserPositionMapper.queryPositionId(userId,parentId);
	}

}
